{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": true,
    "pycharm": {
     "name": "#%%\n"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": "           id                                               data   label  \\\n0     2647506  用户输入:  我的定金退了服务费能退吗？\\n预测意图1: 咨询技术服务费问题  (相似句子：...  [正确意图]   \n1     2647507  用户输入:  货没装成，服务费平台咋没退给我呢\\n预测意图1: 咨询技术服务费问题  (相似...  [正确意图]   \n2     2647508  用户输入:  麻烦退一下司机的技术服务费\\n预测意图1: 咨询技术服务费问题  (相似句子：...  [正确意图]   \n3     2647509  用户输入:  你看下订单以后啊，得多少钱的运费，在平台上还能看看\\n预测意图1: 运费已经支...  [正确意图]   \n4     2647510  用户输入:  货主把我订单取消了，技术服务费为什么不退\\n预测意图1: 咨询技术服务费问题 ...  [正确意图]   \n...       ...                                                ...     ...   \n1995  2649501  用户输入:  技术费退款26\\n预测意图1: 咨询技术服务费问题  (相似句子：技术服务费退...  [正确意图]   \n1996  2649502  用户输入:  单子取消技术服务费为什么不退换\\n预测意图1: 咨询技术服务费问题  (相似句...  [正确意图]   \n1997  2649503  用户输入:  我订到单县的货取消了，技术费什么时候退\\n预测意图1: 咨询技术服务费问题  ...  [正确意图]   \n1998  2649504  用户输入:  小马小马，我在货车网上订一车货，技术服务费怎么没退\\n预测意图1: 咨询技术服...  [正确意图]   \n1999  2649505  用户输入:  技术服务费没有退给我\\n预测意图1: 咨询技术服务费问题  (相似句子：技术服...  [正确意图]   \n\n                                             answer_str  is_off_line  \n0          Wyflkqjor6LmioDmnK/mnI3liqHotLnpl67popgnXQ==            0  \n1          Wyflkqjor6LmioDmnK/mnI3liqHotLnpl67popgnXQ==            0  \n2     Wyflkqjor6LmioDmnK/mnI3liqHotLnpl67popgnLCAn5o...            0  \n3     Wyfov5DotLnlt7Lnu4/mlK/ku5jliLDlubPlj7DlpoLkvZ...            0  \n4          Wyflkqjor6LmioDmnK/mnI3liqHotLnpl67popgnXQ==            0  \n...                                                 ...          ...  \n1995       Wyflkqjor6LmioDmnK/mnI3liqHotLnpl67popgnXQ==            1  \n1996       Wyflkqjor6LmioDmnK/mnI3liqHotLnpl67popgnXQ==            1  \n1997       Wyflkqjor6LmioDmnK/mnI3liqHotLnpl67popgnXQ==            1  \n1998       Wyflkqjor6LmioDmnK/mnI3liqHotLnpl67popgnXQ==            1  \n1999       Wyflkqjor6LmioDmnK/mnI3liqHotLnpl67popgnXQ==            1  \n\n[2000 rows x 5 columns]",
      "text/html": "<div>\n<style scoped>\n    .dataframe tbody tr th:only-of-type {\n        vertical-align: middle;\n    }\n\n    .dataframe tbody tr th {\n        vertical-align: top;\n    }\n\n    .dataframe thead th {\n        text-align: right;\n    }\n</style>\n<table border=\"1\" class=\"dataframe\">\n  <thead>\n    <tr style=\"text-align: right;\">\n      <th></th>\n      <th>id</th>\n      <th>data</th>\n      <th>label</th>\n      <th>answer_str</th>\n      <th>is_off_line</th>\n    </tr>\n  </thead>\n  <tbody>\n    <tr>\n      <th>0</th>\n      <td>2647506</td>\n      <td>用户输入:  我的定金退了服务费能退吗？\\n预测意图1: 咨询技术服务费问题  (相似句子：...</td>\n      <td>[正确意图]</td>\n      <td>Wyflkqjor6LmioDmnK/mnI3liqHotLnpl67popgnXQ==</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>1</th>\n      <td>2647507</td>\n      <td>用户输入:  货没装成，服务费平台咋没退给我呢\\n预测意图1: 咨询技术服务费问题  (相似...</td>\n      <td>[正确意图]</td>\n      <td>Wyflkqjor6LmioDmnK/mnI3liqHotLnpl67popgnXQ==</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>2</th>\n      <td>2647508</td>\n      <td>用户输入:  麻烦退一下司机的技术服务费\\n预测意图1: 咨询技术服务费问题  (相似句子：...</td>\n      <td>[正确意图]</td>\n      <td>Wyflkqjor6LmioDmnK/mnI3liqHotLnpl67popgnLCAn5o...</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>3</th>\n      <td>2647509</td>\n      <td>用户输入:  你看下订单以后啊，得多少钱的运费，在平台上还能看看\\n预测意图1: 运费已经支...</td>\n      <td>[正确意图]</td>\n      <td>Wyfov5DotLnlt7Lnu4/mlK/ku5jliLDlubPlj7DlpoLkvZ...</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>4</th>\n      <td>2647510</td>\n      <td>用户输入:  货主把我订单取消了，技术服务费为什么不退\\n预测意图1: 咨询技术服务费问题 ...</td>\n      <td>[正确意图]</td>\n      <td>Wyflkqjor6LmioDmnK/mnI3liqHotLnpl67popgnXQ==</td>\n      <td>0</td>\n    </tr>\n    <tr>\n      <th>...</th>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n      <td>...</td>\n    </tr>\n    <tr>\n      <th>1995</th>\n      <td>2649501</td>\n      <td>用户输入:  技术费退款26\\n预测意图1: 咨询技术服务费问题  (相似句子：技术服务费退...</td>\n      <td>[正确意图]</td>\n      <td>Wyflkqjor6LmioDmnK/mnI3liqHotLnpl67popgnXQ==</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>1996</th>\n      <td>2649502</td>\n      <td>用户输入:  单子取消技术服务费为什么不退换\\n预测意图1: 咨询技术服务费问题  (相似句...</td>\n      <td>[正确意图]</td>\n      <td>Wyflkqjor6LmioDmnK/mnI3liqHotLnpl67popgnXQ==</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>1997</th>\n      <td>2649503</td>\n      <td>用户输入:  我订到单县的货取消了，技术费什么时候退\\n预测意图1: 咨询技术服务费问题  ...</td>\n      <td>[正确意图]</td>\n      <td>Wyflkqjor6LmioDmnK/mnI3liqHotLnpl67popgnXQ==</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>1998</th>\n      <td>2649504</td>\n      <td>用户输入:  小马小马，我在货车网上订一车货，技术服务费怎么没退\\n预测意图1: 咨询技术服...</td>\n      <td>[正确意图]</td>\n      <td>Wyflkqjor6LmioDmnK/mnI3liqHotLnpl67popgnXQ==</td>\n      <td>1</td>\n    </tr>\n    <tr>\n      <th>1999</th>\n      <td>2649505</td>\n      <td>用户输入:  技术服务费没有退给我\\n预测意图1: 咨询技术服务费问题  (相似句子：技术服...</td>\n      <td>[正确意图]</td>\n      <td>Wyflkqjor6LmioDmnK/mnI3liqHotLnpl67popgnXQ==</td>\n      <td>1</td>\n    </tr>\n  </tbody>\n</table>\n<p>2000 rows × 5 columns</p>\n</div>"
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "file_name = r'./data/智能IM线上结果准确率确认-20230823l.jsonl'\n",
    "df = pd.read_json(file_name,orient='record',lines=True)\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "outputs": [
    {
     "data": {
      "text/plain": "931"
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "def check_right(item):\n",
    "    if item[\"label\"]:\n",
    "        return 1\n",
    "    else:\n",
    "        return 0\n",
    "df['right'] = df.apply(check_right,axis=1)\n",
    "df_origin = df[df['is_off_line'] == 0]\n",
    "sum(df_origin[\"right\"])"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "outputs": [
    {
     "data": {
      "text/plain": "957"
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_now = df[df['is_off_line'] == 1]\n",
    "sum(df_now[\"right\"])"
   ],
   "metadata": {
    "collapsed": false,
    "pycharm": {
     "name": "#%%\n"
    }
   }
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}